import { post } from './request'

const uploadApi = {
  article: '/ib/article'
}

/**
 * 文章列表
 * @param params
 * @returns {Promise<T>}
 */
export function getArticleList (params) {
  return post(`${uploadApi.article}/list`, params).then(res => { return res })
}

export function saveOrUpdateArticle (params) {
  if(params.id) {
    return post(`${uploadApi.article}/update`, params).then(res => { return res })
  }
  return post(`${uploadApi.article}/save`, params).then(res => { return res })
}
